ThinkPHP5


think\model\Pivot
library\think\model\Pivot.php at line 16

Class Pivot

Model
└─Pivot

public class Pivot
extends Model

Class Model

Method:
static PaginatorCollection paginate(integer $listRows = 15, boolean $simple = false, array $config = []) 分页查询
static mixed value($field, $default = null) 得到某个字段的值
static array column($field, $key = '') 得到某个列的数组
static integer count($field = '*') COUNT查询
static integer sum($field = '*') SUM查询
static integer min($field = '*') MIN查询
static integer max($field = '*') MAX查询
static integer avg($field = '*') AVG查询
static setField($field, $value = '')
static Query where($field, $op = null, $condition = null) 指定AND查询条件
static static findOrFail($data = null) 查找单条记录 如果不存在则抛出异常

Constructor Summary
void

__construct(array|object data, string table)

架构函数

Methods inherited from think\Model
__construct, all, allowField, append, auto, autoCompleteData, autoWriteTimestamp, belongsTo, belongsToMany, create, data, db, delete, destroy, eagerlyResult, eagerlyResultSet, event, get, getAttr, getData, getDb, getError, getPk, has, hasMany, hasManyThrough, hasOne, hasWhere, hidden, init, initialize, isPk, isUpdate, jsonSerialize, offsetExists, offsetGet, offsetSet, offsetUnset, parseModel, parseQuery, readTransform, relation, relationQuery, save, saveAll, scope, setAttr, toArray, toJson, trigger, update, useGlobalScope, validate, validateData, validateFailException, visible, writeTransform

Constructor Detail

library\think\model\Pivot.php at line 25

__construct

public void __construct(array|object data, string table)

架构函数

Parameters:
data - 数据
table - 中间数据表名

ThinkPHP5